import { createApp } from 'vue'
import './style.less'
import App from './App.vue'
const app=createApp(App);
//注册路由
import router from './router'
//注册pinia
import {createPinia} from 'pinia'
const store=createPinia()
//注册mitt
import mitt from 'mitt'
const Mit=mitt();
app.config.globalProperties.$Bus=Mit;

declare module 'vue'{
    export interface ComponentCustomProperties{
        $Bus:typeof Mit
    }
}


//路由前置守卫
router.beforeEach((to,from,next)=>{
    //设置网页标题
    document.title=to.meta.title as string;
    
    next();
})


app.use(router).use(store).mount('#app')
